package com.example.demo.controller;

import com.example.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@ResponseBody   //返回一个json类型的字符串
public class TestController {
    @Autowired
    UserService userService;

    @RequestMapping("/getmsg")
    public String getmsg(){
        return userService.print();
    }
}
